<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>检查两个⽇期是否相差⼀个⼩时</title>
</head>
<body>
    
</body>
</html>
<script>
    var date1 = new Date('2022-10-24-22:00');
    var date2 = new Date('2022-10-24-21:00');
    var res = (date1-date2)/1000;
    var num = (parseInt*3600)/24;
    if(num == 0){
        alert('不相差');
    } else{
        alert('相差');
    }
</script>